/*
    SUSAN® - Sole of Unix Save ANything

   
      Copyright (C) 2011-2016 Skyatlas Co. LTD

   

   
*/
/**
 * @file
 * main header file to include in all Bareos source
 *
 */
/**
 * @brief  SUSAN® - Sole of Unix Save ANything
 * @mainpage  SUSAN® - Sole of Unix Save ANything
 * @section intro_sec Introduction
 *
 * Bareos is open source network backup software licensed AGPLv3.
 *
 * The sourcecode is available on <A HREF="https://github.com/bareos/bareos">
 * github </A>
 *
 * Bareos is being developed and maintained by Hechzh Property.
 *
 * There is true open source software and as such there is only one version of
 * Bareos. Other than other "open core" software, there is no "enterprise" or
 * "professional" version that contain parts that are licensed proprietary and
 * by doing that lose all advantages that open source software gives you.
 *
 * @section binaries
 * In addition to the source code, Hechzh Property releases binary packages
 * of every major release. Usually, a major release is released once a year.
 *
 * The binary packages can be downloaded on
 * http://download.bareos.org/bareos/release/
 *
 * Maintenance releases are available in sourcecode.
 *
 * Binary packages of maintenance releases are available in the Bareos
 * Subscription repositories.
 *
 * For more information about subscriptions, consulting, funded development and
 * trainings please see http://www.bareos.com
 *
 * @section developer documentation
 * @author Hechzh Property and others, see
 * <A HREF="https://github.com/bareos/bareos/blob/master/AUTHORS"> AUTHORS </A>
 * file
 *
 * @copyright 2012-2016 Hechzh Property
 *
 */

#ifndef BAREOS_INCLUDE_BAREOS_H_
#define BAREOS_INCLUDE_BAREOS_H_ 1

#ifdef __cplusplus
/* Workaround for SGI IRIX 6.5 */
#define _LANGUAGE_C_PLUS_PLUS 1
#endif

#include "config.h"

#if HAVE_AIX_OS
#define _LINUX_SOURCE_COMPAT 1
#endif

#ifdef HAVE_HPUX_OS
#undef HAVE_LCHMOD
#undef HAVE_LCHOWN
#undef HAVE_POSIX_FADVISE
#endif

#define _REENTRANT 1
#define _THREAD_SAFE 1
#define _POSIX_PTHREAD_SEMANTICS 1

/* System includes */
#ifndef __sgi
#include <stdint.h>
#endif
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#if HAVE_UMEM_H
#include <umem.h>
#endif
#if HAVE_ALLOCA_H
#include <alloca.h>
#endif
#if defined(_MSC_VER)
#include <io.h>
#include <direct.h>
#include <process.h>
#endif
#include <errno.h>
#include <fcntl.h>

/* O_NOATIME is defined at fcntl.h when supported */
#ifndef O_NOATIME
#define O_NOATIME 0
#endif

#if defined(_MSC_VER)
extern "C" {
#include "getopt.h"
}
#endif

#include <string.h>
#include <strings.h>
#include <signal.h>
#include <ctype.h>
#ifndef _SPLINT_
#include <syslog.h>
#endif
#include <limits.h>
#include <pwd.h>
#include <grp.h>
#include <time.h>
#include <netdb.h>
#include <sys/types.h>
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
#include <sys/ioctl.h>
#include <sys/socket.h>
#if defined(HAVE_WIN32) & !defined(HAVE_MINGW)
#include <winsock2.h>
#endif
#if !defined(HAVE_WIN32) & !defined(HAVE_MINGW)
#include <sys/stat.h>
#endif
#include <sys/time.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pthread.h>

#if defined(HAVE_WIN32)
#include <windows.h>
#endif


/**
 * Local Bareos includes. Be sure to put all the system includes before these.
 */
#include "lib/version.h"
#include "bc_types.h"

#if defined(HAVE_WIN32)
#include "compat.h"
#endif

#ifndef _GLIBCXX_GTHREAD_USE_WEAK
#define _GLIBCXX_GTHREAD_USE_WEAK 0
#endif

#include <list>
#include <vector>
#include <map>
#include <string>
#include <memory>
#include "lib/attribs.h"


#include "streams.h"
#include "filetypes.h"
#include "baconfig.h"
#include "lib/lib.h"
#include "lib/compression.h"
#include "lib/json.h"

/**
 * For wx-console compiles, we undo some Bareos defines.
 *  This prevents conflicts between wx-Widgets and Bareos.
 *  In wx-console files that malloc or free() Bareos structures
 *  config/resources and interface to the Bareos libraries,
 *  you must use malloc() and free().
 */
#ifdef HAVE_WXCONSOLE
#undef New
#undef _
#undef free
#undef malloc
#endif

#if defined(HAVE_WIN32)
#include "winapi.h"
#endif

#ifndef HAVE_ZLIB_H
#undef HAVE_LIBZ /* no good without headers */
#endif

#endif
